<template>
	<el-form 
		:model="ruleForm" 
		label-width="120px"
		ref="ruleForm">
		<el-form-item 
			label="姓名" 
			prop="name" 
			:rules="rules.empty">
			<el-input v-model="ruleForm.name" size="small" style="width: 280px;"></el-input>
		</el-form-item>
		<el-form-item 
			label="涨幅比例" 
			prop="scale" 
			:rules="rules.empty">
			<el-input v-model="ruleForm.scale" size="small" style="width: 280px;">
				<i slot="suffix">%</i>
			</el-input>
		</el-form-item>
		{{ruleForm}}
	</el-form>
</template>

<script>
export default {
	props:{
		value:Object
	},
	computed:{
		ruleForm(){
			return this.value;
		}
	},
	data () {
		return {
			valid:false,
			rules: {
				empty:[
					{ required: true, message: '不能为空', trigger: 'blur' }
				]
			}
		}
	},
	methods:{
		// 验证
		submit(){
			this.$refs.ruleForm.validate((valid,object) => {
				this.valid = valid;
			})
		}
	}
}
</script>

<style lang="scss" scoped>


</style>